Repository navigation
feat(active-minutes): judge a long pause by the hour of day - #42
Merged
Merged
Conversation
A session transcript cannot tell a person working the task outside the chat from an agent parked on an approval, so counting every pause that a typed prompt ends billed approval waits as work. A pause over 30 minutes that ends with a typed prompt and has no other evidence now counts when it lies wholly inside work hours (Monday to Friday 07:00 to 18:00, both ends inclusive, start and end on the same date) and still fits --attended-max. Any part outside them (a weekend, before or after the window, across midnight) makes it assumed idle. Both are defaults the agent overturns from the record with --keep and --drop, and each printed cause names the flag. New --work-hours HH:MM-HH:MM moves the hours (weekdays stay fixed, a bad value exits 2). The window is read in the display zone per timestamp, so a daylight-saving change needs no special case. Gaps of 30 minutes or less, background-task gaps, holds, stated breaks, harness-ended gaps, --also, --strict and --brief behave as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
bin/active-minutesnow judges a long pause by the hour of day.A pause over 30 minutes that ends with a prompt the Operator typed, with no other evidence:
--attended-maxhours;Both are defaults the agent overturns from the record with
--keepand--drop, and each printed cause names the flag. New option--work-hours HH:MM-HH:MM(default07:00-18:00) moves the hours; the weekdays stay fixed, and a value that is not a start before an end exits 2 with a message. The window is read in the display zone per timestamp, so a daylight-saving change needs no special case. Gaps of 30 minutes or less, background-task gaps, holds, stated breaks, harness-ended gaps,--also,--strictand--briefbehave as before.Files:
.claude-config/bin/active-minutes,.claude-config/bin/tests/active-minutes-test.py,.claude-config/bin/README.md(the tool's section),CONTEXT/work-tracking.md(a "Measuring the time" line in the time example),CHANGELOG.md.SKILLS/harness/SKILL.mdonly points at the tool, so it is unchanged.Why
A session transcript cannot tell a person working the task outside the chat from an agent parked on an approval. Counting every pause that a typed prompt ends, up to
--attended-max, billed approval waits as work. The hour of day sets the default instead, and the agent decides from what the pause was waiting on.How it was tested
python3 -B .claude-config/bin/tests/active-minutes-test.py:Ran 83 tests ... OK(also undersandbox-run --no-bind --no-net --ro-bind "$PWD", the CI form).Ran 83 tests ... FAILED (failures=33), from 21 distinct tests: 17 of the 18 new cases, plus 4 existing ones the change touches (the overnight pause, the 4 hour ceiling, the docstring and the help text). The 18th new case, other gap causes on a Saturday night, is a regression guard and passes both ways. Against the new tool: all green.--attended-maxceiling inside work hours,--keepand--drop,--work-hoursmoving the window and rejecting ten bad values (also on a one-event transcript, exit 2),--brief, other gap causes unchanged on a Saturday night, and daylight saving on both sides of the fall and spring changes plusTZand--tz-offset.--attended-maxno longer counts it (the hour decides, not the length); the 4 hour ceiling case also asserts the cause; the docstring and help cases name--work-hours. None deleted.python3 -m py_compileon both files;python3 -B .claude-config/bin/tests/ci-gate-test.py:Ran 15 tests ... OK.HOME(deploy twice, thenverify-ops.sh):verify-ops: 30 ok · 0 warn · 0 fail..claude-config/bin/secrets-scan.sh CONTEXT SKILLS .claude-config: exit 0, no findings.Models: Mythos 5.2 · T3 Code (Claude Code harness)